﻿using UnityEngine;
using pooling;

public class BurstParticle : PoolingObject
{
    private ParticleSystem particle;
    private ParticleSystem.MainModule main;

    private void Awake()
    {
        particle = GetComponent<ParticleSystem>();
        main = particle.main;
    }

    public void InitParticle(Vector3 position, Color  color)
    {
        transform.position = position;
        main.startColor = color - new Color(0,0,0,0.2f);
        particle.Play();

        Invoke("OnRelease", 1.2f);
    }
}
